<?php
namespace app\admin\controller;

/**
 * 最高管理员
 *
 * @author YangPan
 *         @date 2017-08-29
 *        
 */
class Admin extends Base
{

    public function _initialize()
    {
        parent::_initialize();
        
        if(session('user_account') != 'admin') {
            session('user_id', null);
            $this->redirect('admin/index/login');
        }
    }
    
    // 账号列表页面
    public function lists()
    {
        $query = []; //定义分页传值
        $res = db('customer')->order('create_time desc')->paginate(100, false, ['query' => $query]);
        
        $page = $res->render();
        $this->assign('res', $res);
        $this->assign('page', $page);
        return $this->fetch();
    }
    
    // 编辑
    public function edit()
    {
        
        return $this->fetch();
    }
}